from src.model import UserPrefs

import re

# Command syntax: @username /mute
class MuteCommand:
    def process(self, text):
        m = re.search('^.(.*)\s+/mute$', text, re.U);
        if m != None:
            username = m.group(1);
            person = UserPrefs.person_by_name(username)
            if person != None:
                person.pacify()
            return True
        return False